package com.rf.richfitwheel.workflow.feignclient;

import com.rf.richfitwheel.admin.sys.model.OrgHasChildren;
import com.rf.richfitwheel.admin.sys.model.OrgHasParent;
import com.rf.richfitwheel.admin.sys.model.OrgVO;
import com.rf.richfitwheel.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author hushouquan
 */
@FeignClient(name="RICHFITWHEEL-ADMIN-SERVER/sys/org")
public interface SysOrgFeignService{
    
    @PostMapping("/getOrgVOByOrgCode")
    public R getOrgVOByOrgCode(@RequestBody String orgCode);
    
    @PostMapping("/getOrgVOObjectByOrgCode")
    public OrgVO getOrgVOObjectByOrgCode(@RequestBody String orgCode);
    
    @RequestMapping(value = "/treeListIncludeDeptByIdDsb/{id}")
    @ResponseBody
    public List<OrgHasChildren> treeListIncludeDeptByIdDsb(@PathVariable("id") String id) throws Exception;
    
    /**
     * 向上查询直至顶级
     * @param orgId 机构id
     * @return OrgHasParent
     */
    @PostMapping("/getOrgListByOrgIdUpHasNoSelfWithTree")
    public OrgHasParent getOrgListByOrgIdUpHasNoSelfWithTree(@RequestBody String orgId) throws Exception;
}
